FROM 139.199.172.167:5000/common/alpine:latest

RUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.7/main/ > /etc/apk/repositories \
 && apk add -U tzdata \
 && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ARG ARG_PROJECT_NAME
ARG ARG_ENV_NAME

ENV PROJECT_NAME=$ARG_PROJECT_NAME
ENV ENV_NAME=$ARG_ENV_NAME

COPY ./bin/${PROJECT_NAME} /app/bin/
COPY ./bin/script /app/bin/script/
WORKDIR /app/bin

RUN echo ${PROJECT_NAME}
RUN echo ${ENV_NAME}
RUN chmod +x ${PROJECT_NAME}
ENTRYPOINT ./${PROJECT_NAME} --config=./script/${ENV_NAME}.yaml
